package com.cndw.kungfu.domain;

import java.util.List;

import com.cndw.kungfu.ext.LogUtil;
import com.cndw.kungfu.ext.StringProcesser;
import com.cndw.kungfu.model.Context;
import com.cndw.kungfu.vo.MonsterVO;

/**
 * 系统怪物分布实体类
 * 
 * @author fantadust
 * @date 2011-4-29 下午04:57:29
 */
public class MonsterDeploy {	
	
	private int id;// 系统id
	private String name;// 别名
	private int sceneId;// 场景id
	private int x;// x
	private int y;// y
	private int defaultMonsterId;// 默认怪物
	private String monsterIds;// 怪物列表
	private List<Integer> monsterIdsList;
	/**
	 * 遇见怪物触发剧情脚本
	 */
	private int storyOnSee;
	/**
	 * 杀死怪物触发剧情脚本
	 */
	private int storyOnDead;
	/**
	 * 剧情激活需要任务
	 */
	private int storyOnTask;
	/**
	 * 刷新脚本
	 */
	private int refreshApp;

	private MonsterVO defaultMonster;// 默认怪物vo
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getSceneId() {
		return sceneId;
	}
	public void setSceneId(int sceneId) {
		this.sceneId = sceneId;
	}
	public int getX() {
		return x;
	}
	public void setX(int x) {
		this.x = x;
	}
	public int getY() {
		return y;
	}
	public void setY(int y) {
		this.y = y;
	}
	public int getDefaultMonsterId() {
		return defaultMonsterId;
	}
	public void setDefaultMonsterId(int defaultMonsterId) {
		this.defaultMonsterId = defaultMonsterId;
	}
	public String getMonsterIds() {
		return monsterIds;
	}
	public int getStoryOnSee() {
		return storyOnSee;
	}
	public void setStoryOnSee(int storyOnSee) {
		this.storyOnSee = storyOnSee;
	}
	public int getStoryOnDead() {
		return storyOnDead;
	}
	public void setStoryOnDead(int storyOnDead) {
		this.storyOnDead = storyOnDead;
	}
	public int getStoryOnTask() {
		return storyOnTask;
	}
	public void setStoryOnTask(int storyOnTask) {
		this.storyOnTask = storyOnTask;
	}
	public int getRefreshApp() {
		return refreshApp;
	}
	public void setRefreshApp(int refreshApp) {
		this.refreshApp = refreshApp;
	}
	public void setMonsterIds(String monsterIds) {
		this.monsterIds = monsterIds;
		if (monsterIds != null && monsterIds.length() > 0) {
			try {
				monsterIdsList = StringProcesser.toIntList(monsterIds);
			} catch (Exception e) {
				e.printStackTrace();
			}

		}
	}
	public List<Integer> getMonsterIdsList() {
		return monsterIdsList;
	}
	public MonsterVO getDefaultMonster() {
		if (defaultMonster == null) {
			Monster abcd = Context.getUndercityServer().getMonster(defaultMonsterId);
			if (abcd != null) {
				defaultMonster = abcd.toMonsterVo();
			} else {
				LogUtil.getMain().error("MonsterDeploy err | id :"+id+"| defaultMonster ");				
			}
		}
		return defaultMonster;
	}
	public void setDefaultMonster(MonsterVO defaultMonster) {
		this.defaultMonster = defaultMonster;
	}

}
